using System.Collections.Generic;
using System.ComponentModel;
using Blazing.BusinessObjects.Cms;
using Blazing.BusinessObjects.Queries;

namespace Blazing.WebFacade
{
    [System.ComponentModel.DataObject]
    public class ImageController
    {
        #region ImageTypes
        [DataObjectMethod(DataObjectMethodType.Delete)]
        public void DeleteImageType(ImageType imagetype)
        {
            imagetype.Delete();
            imagetype.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Insert)]
        public int NewImageType(ImageType imagetype)
        {
            imagetype.Save();
            return imagetype.ID;
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Update)]
        public void UpdateImageType(ImageType imagetype)
        {
            imagetype.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select)]
        public IList<ImageType> GetImageTypes()
        {
            return ImageType.Search(QrySearchImageTypes.Query());
        }
        #endregion
    }
}
